home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_olv_bossdoor.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  237 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_bossdoor.cog
  4. #
  5. # [SXC & DS]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message     activate
  14. message    arrived
  15. message     startup
  16. message     timer
  17.  
  18. sound       fwoosh=gen_torchlitet_c.wav     local
  19. sound       burning=gen_torch_burnin_c.wav  local
  20. thing       player                          local
  21. thing       torchobj0
  22. thing        torchobj1
  23. thing       flamepos0
  24. thing        flamepos1
  25. template    flametemplate
  26. vector      minlite                           local
  27. vector      maxlite                              local
  28. vector      zerolite                          local
  29. int         lit=0                             local
  30. int        donelit0=0                    local
  31. int        donelit1=0                    local
  32. keyframe    in_light=in_light_stuff.key        local
  33.  
  34.  
  35. #  Door stuff
  36. thing       door0                            
  37. flex        movespeed=1
  38. int        numtorch=0                local
  39. sector      doorsector                local
  40. int         doorstatus                local
  41. int         movestatus                local
  42. int        speak0                local
  43. sound        doorop=inxj103.wav        local
  44. sound        plyerdoor=inxj101.wav        local
  45.  
  46. #  steves junk
  47. thing        t_InMainTunnelPt
  48. cog        snakecog
  49.  
  50. # Subroutines
  51. flex        checkstatus                local
  52. flex        open_doors                local
  53.  
  54. # Boss Cutscene Stuff
  55. int        this_door                        # set 1 if boss's door.
  56. int        curcam                        local
  57. thing        campos0
  58. thing        camtarg0
  59. sound        music0=mus_sea_volodbridge.wav            local
  60. sound        boss_sayline=ov04j01.wav            local #Snakes! I hate snakes,..big ones!
  61. flex        boss_cutscene                    local
  62.  
  63. flex        playerAlpha                        local
  64.  
  65.  
  66. end
  67.  
  68. # ========================================================================================
  69.  
  70. code
  71.  
  72. startup:
  73.     doorsector = GetThingSector(door0);
  74.     SetSectorAdjoins(doorsector, 0);
  75.     player = GetLocalPlayerThing();
  76.     minlite = VectorSet(0.77, 0.45, 0.06);
  77.     maxlite = VectorSet(0.89, 0.64, 0.3);
  78.     zerolite= VectorSet(0.0, 0.0, 0.0);
  79.     SetThingLight(torchobj0, zerolite, 0.3, 0.1);
  80.     SetThingLight(torchobj1, zerolite, 0.3, 0.1);
  81.     return;
  82.  
  83. # ........................................................................................
  84. activate:
  85.     if ((GetSenderRef() == torchobj0) && (GetCurWeapon(player) == 13))
  86.     {
  87.         if(donelit0 == 1) return;
  88.         donelit0=1;
  89.         lit = 1;
  90.         SetActorFlags(player, 0x200000);
  91.         MakeMeStop();
  92.         StartCutscene(0);
  93.         PlayKey(player, in_light, 4, 0x12, 1);
  94.         CreateThing(flametemplate, flamepos0);                                 
  95.         SetThingLight(torchobj0, minlite, 0.3, 0.0);
  96.         PlaySoundThing(fwoosh, torchobj0, 0.4, 3, 10, 0);
  97.         numtorch = (numtorch)+1;
  98.         SetTimer(0.1);
  99.         ClearActorFlags(player, 0x200000);
  100.         EndCutscene();
  101.         if (numtorch >= 2)
  102.         {
  103.             call checkstatus;
  104.               if(movestatus) return;
  105.             if(doorstatus == 0)
  106.             {
  107.                 call open_doors;
  108.             }
  109.         }
  110.         return;
  111.     }
  112.     if ((GetSenderRef() == torchobj1) && (GetCurWeapon(player) == 13))
  113.     {
  114.         if(donelit1 == 1) return;
  115.         donelit1=1;
  116.         lit = 2;
  117.         SetActorFlags(player, 0x200000);
  118.         MakeMeStop();
  119.         PlayKey(player, in_light, 4, 0x12, 1);
  120.         CreateThing(flametemplate, flamepos1);                                 
  121.         SetThingLight(torchobj1, minlite, 0.3, 0.0);  
  122.         PlaySoundThing(fwoosh, torchobj1, 0.4, 3, 10, 0);
  123.         numtorch = (numtorch)+1;
  124.         SetTimer(0.1);
  125.         ClearActorFlags(player, 0x200000);
  126.         EndCutscene();
  127.         if (numtorch >= 2)
  128.         {
  129.             call checkstatus;
  130.               if(movestatus) return;
  131.             if(doorstatus == 0)
  132.             {
  133.                 call open_doors;
  134.             }
  135.         }
  136.         return;
  137.     }
  138.     if(GetSenderRef() == door0)
  139.     {
  140.         MakeMeStop();
  141.         DeselectWeaponWait(player);
  142.         PlayMode(player, 60, 0);
  143.         speak0=PlayVoice(player, plyerdoor, 1.0, 0);
  144. #        call randlocklines;
  145.         WaitForSound(speak0);
  146.         ClearActorFlags(player, 0x200000);
  147.         return;
  148.     }
  149.  
  150.     return;
  151.  
  152. # ........................................................................................
  153. timer:
  154.     if (lit == 1)
  155.     {
  156.     ThingLightAnim(torchobj0, minlite, 0.3, maxlite, 0.3, 1.0);
  157.     PlaySoundThing(burning, torchobj0, 1, 3, 10, 1);
  158.     return;
  159.     }
  160.     if (lit == 2)
  161.     {
  162.     ThingLightAnim(torchobj1, minlite, 0.3, maxlite, 0.3, 1.0);
  163.     PlaySoundThing(burning, torchobj1, 1, 3, 10, 1);
  164.     return;
  165.     }
  166.  
  167. #...........................................................................................................
  168.  
  169. Arrived:
  170.  
  171.     if (GetSenderRef() == door0)
  172.     {
  173.     if(this_door == 1)
  174.     {
  175.     goto boss_cutscene;
  176.     return;
  177.     }
  178.     PlayVoice(player, doorop, 1.0, 0);
  179.     }          
  180.     return;
  181.  
  182. #----------------------------------------------------------------------------------
  183.  
  184. open_doors:
  185.     SetSectorAdjoins(doorsector, 1);
  186.     movetoframe(door0, 1, movespeed);
  187.     SendMessageEx(snakecog, 27, t_InMainTunnelPt, 0, 0, 0);        # (cogRef, User0, Location-Thing, 0, 0, 0)
  188.     return;
  189.  
  190. CheckStatus:
  191.     moveStatus = 0;
  192.     doorStatus = 0;
  193.     if (door0 >= 0)
  194.     {
  195.             moveStatus = moveStatus + IsThingMoving(door0);
  196.             doorStatus = doorStatus + GetCurFrame(door0);
  197.     }
  198.     return;
  199.  
  200. #----------------------------------------------------------------------------------
  201. boss_cutscene:
  202.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  203.     sleep(0.3);            
  204.     curcam = GetCurrentCamera();
  205.     SetCameraLookInterp(2, 0);
  206.     SetActorFlags(player, 0x200000);
  207.  
  208. playerAlpha = GetThingAlpha(player);
  209.  
  210.     MakeMeStop();
  211.     StartCutscene(1);
  212.     SetCameraFocus(2, campos0);
  213.     SetCameraSecondaryFocus(2, camtarg0);
  214.     SetCurrentCamera(2);
  215.     SetCameraFOV(100, 0, 0.0);
  216.     SetCameraFOV(85, 1, 3.0);
  217.     sleep(1.5);
  218.     SendMessageEx(snakecog, user1, 2, 0, 0, 0);            
  219.     sleep(1.9);
  220.     ResetCameraFOV(0, 0.0);
  221.     SendMessageEx(snakecog, user1, 1, 0, 0, 0);            # Clear t_Boss cutscene mode.
  222.     SetCurrentCamera(curcam);
  223.     SetThingAlpha(player, 1.0);
  224.     EndCutscene();
  225.     ClearActorFlags(player, 0x200000);
  226.  
  227. if(playerAlpha < GetThingAlpha(Player))
  228. {
  229. SetThingAlpha(player, playerAlpha);
  230. }
  231.  
  232.     PlayVoice(player, boss_sayline, 1.0, 0);
  233.     return;
  234.  
  235.  
  236. end
  237.